import request from '@/config/axios'

// 标签分类 VO
export interface TagClassifyVO {
  id: number // 唯一自增id
  name: string // 分类名字
  parentId: number // 父标签分类id
}

// 标签分类 API
export const TagClassifyApi = {
  // 查询标签分类分页
  getTagClassifyPage: async (params: any) => {
    return await request.get({ url: `/lm/tag-classify/page`, params })
  },

  // 查询标签分类详情
  getTagClassify: async (id: number) => {
    return await request.get({ url: `/lm/tag-classify/get?id=` + id })
  },

  // 新增标签分类
  createTagClassify: async (data: TagClassifyVO) => {
    return await request.post({ url: `/lm/tag-classify/create`, data })
  },

  // 修改标签分类
  updateTagClassify: async (data: TagClassifyVO) => {
    return await request.put({ url: `/lm/tag-classify/update`, data })
  },

  // 删除标签分类
  deleteTagClassify: async (id: number) => {
    return await request.delete({ url: `/lm/tag-classify/delete?id=` + id })
  },

  // 导出标签分类 Excel
  exportTagClassify: async (params) => {
    return await request.download({ url: `/lm/tag-classify/export-excel`, params })
  }
}